﻿@model List<Image>

@{
    var imgHp = new ImageHelper();

    int haveVideo = 0;
    
    List<Video> videos = ViewBag.Videos;
}

@foreach(Image img in Model)
{
    bool isStandard = imgHp.Standard(img.Width, img.Height);
    
    <img data-original="@img.Url" 
         data-standard="@(isStandard ? 1 : 0)" 
         class="img-thumbnail imgThumb" 
         src="@img.Url?w=100&h=100" 
         width="50" height="50"
         onclick="new Product().ThumbImageClick(this);" />
}

@if (videos.Count > 0)
{
    haveVideo = 1;

    foreach (Video vid in videos)
    {
        <img data-original="@vid.Url" 
             class="img-thumbnail vidThumb" 
             src="/img/video-icon.png?w=100&h=100" 
             width="50" height="50"
             onclick="new Product().ThumbVideoClick(this);" />
    }
}

@Html.Hidden("HaveVideo", haveVideo)